package org.emailclassifier.classifiers;


import org.emailclassifier.preprocessing.DataSetDocument;
import org.emailclassifier.preprocessing.EmailDataSet;

/**
 * 
 * Abstract base class for classifiers.
 * 
 * @author Ante Znaor, Lourens Elzinga
 *
 */

public abstract class ClassifierBase {
	
	/**
	 * Training set used by the Naive Bayes classifier
	 */
	EmailDataSet m_trainingSet = null;
	
	/**
	 * Whether or not the classifier has been trained.
	 * Changing any training parameter will reset this to false.
	 * 
	 * @see train
	 */
	boolean m_isTrained = false;
	
	/**
	 * Adds a training sample to the classifier
	 * @param category The category the sample belongs to
	 * @param body The document to train on
	 */
	public void setTrainingSet(EmailDataSet set)
	{
		m_trainingSet = set;
		m_isTrained = false;
	}
	
	public EmailDataSet getTrainingSet()
	{
		return m_trainingSet;
	}
	
	public boolean isTrained()
	{
		return m_isTrained;
	}

	public abstract void train();
	public abstract String[] determineClasses(DataSetDocument content);
	public abstract String getDescription();
	
}
